﻿using MediatR;
using SheepStorage.API.Application.Command.BodySizeCommand;
using SheepStorage.API.Application.Command.BuildingManagementCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.DataImp;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.BodySizeHandler
{
    public class BodySizeFtHandler : IRequestHandler<BodySizeFtCommand, Results<BodySize>>
    {

        private readonly IBodySizeService service;

        public BodySizeFtHandler(IBodySizeService service)
        {
            this.service = service;
        }
        public async Task<Results<BodySize>> Handle(BodySizeFtCommand request, CancellationToken cancellationToken)
        {
            return Results<BodySize>.DataResult(service.GetFtBodySize(request.BodySizeId));
        }
    }
}
